package config

import "log"

var defaultConfig CliConfig = CliConfig{
	DbConfig: &DatabaseConfig{
		Dsn:         "root:123456@tcp(10.0.1.35:13307)/DomainDrivenDesignDemo?charset=utf8mb4&parseTime=True&loc=Local",
		PrepareStmt: true,
	},
	ServerCfg: []*ServerConfig{{ServerType: Dubbo, Port: 8081}, {ServerType: Http, Port: 8080}},
}

type CliConfig struct {
	ServerCfg []*ServerConfig `yaml:"server_config"`
	DbConfig  *DatabaseConfig `yaml:"db_config"`
}

func LoadConfig() *CliConfig {
	// TODO:加载配置
	log.Printf("load config")
	return &defaultConfig
}
